package chapter01;

import java.util.Arrays;

public class Test25_Bubble {
    public static void main(String[] args) {
        int[] a = {1,2,3,21,4,56,27,85,21};
        for(int j=0;j<a.length;j++){
            for(int i=0;i<a.length-1-j;i++){
                if(a[i]>a[i+1]){
                    int tmp = a[i];
                    a[i] = a[i+1];
                    a[i+1] = tmp;
                }
            }
            System.out.println(Arrays.toString(a));
        }


    }
}
